﻿<?xml version="1.0" encoding="utf-8"?>
<!--
=====================================================================
Stages: 
    {dev, [sit,] uat, prod, default, auto}

"dev"  : Development
"sit"  : System Integration Test
"uat"  : User Acceptance Testing
"prod" : Production

"default": 
    This section is read first regardless of what stage 
    is specified. Then, if a different stage has been specified,
    that stage's section is read and allowed to overwrite the 
    values from the default section.

"auto":
    The value "auto" signals that the hosts section should be read
    to determine the current stage. This stage value should only be
    applied to the application.settings element, not to a stage element.
    
Other stages can be defined as needed.
=====================================================================
-->

<application.settings>

  <!-- =============== HOSTS: Map machine name to stage. =============== -->
  <hosts>
    <!-- New developers will need to add a host entry for their PC here: -->
    <!-- 
    <host name="<INSERT DEV PC NAME HERE>" stage="dev" comment="Home" />
    <host name="<INSERT PROD PC NAME HERE>" stage="prod" comment="Joe"/>
    -->
  </hosts>

  <!-- 
    Default Stage: 
    These values are read first, then optionally overwritten by values from specific stage .
  -->
  <stage name="default">
    <setting key="PluginPath" value="Plugins" />
    <setting key="log4net">
      <log4net>
        <appender name="trace" type="log4net.Appender.TraceAppender, log4net">
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="telnetAppender" type="log4net.Appender.TelnetAppender,log4net">
          <threshold value="ALL"/>
          <param name="port" value="7510"/>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="consoleDebug" type="log4net.Appender.ColoredConsoleAppender, log4net">
          <threshold value="ALL"/>
          <mapping>
            <level value="DEBUG"/>
            <foreColor value="Green, HighIntensity"/>
          </mapping>
          <mapping>
            <level value="WARN"/>
            <foreColor value="White, HighIntensity"/>
          </mapping>
          <mapping>
            <level value="INFO"/>
            <foreColor value="Yellow, HighIntensity"/>
          </mapping>
          <mapping>
            <level value="ERROR"/>
            <foreColor value="Red, HighIntensity"/>
          </mapping>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net">
          <threshold value="ALL"/>
          <param name="File" value="logs/TaskServiceHarness"/>
          <param name="AppendToFile" value="true"/>
          <param name="RollingStyle" value="Date"/>
          <param name="DatePattern" value=".yyyy.MM.dd.'txt'"/>
          <param name="StaticLogFileName" value="false"/>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="eventLog" type="log4net.Appender.EventLogAppender,log4net">
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <root>
          <level value="ALL"/>
          <appender-ref ref="consoleDebug"/>
          <appender-ref ref="rollingFile"/>
          <appender-ref ref="eventLog"/>
          <appender-ref ref="telnetAppender"/>
        </root>
      </log4net>
    </setting>
  </stage>

  <!-- =============== DEVELOPMENT =============== -->
  <stage name="dev">
    <setting key="log4net">
      <log4net>
        <appender name="trace" type="log4net.Appender.TraceAppender, log4net">
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="telnetAppender" type="log4net.Appender.TelnetAppender,log4net">
          <threshold value="ALL"/>
          <param name="port" value="7510"/>
         <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="consoleDebug" type="log4net.Appender.ColoredConsoleAppender, log4net">
          <threshold value="ALL"/>
          <mapping>
            <level value="DEBUG"/>
            <foreColor value="Green, HighIntensity"/>
          </mapping>
          <mapping>
            <level value="WARN"/>
            <foreColor value="White, HighIntensity"/>
          </mapping>
          <mapping>
            <level value="INFO"/>
            <foreColor value="Yellow, HighIntensity"/>
          </mapping>
          <mapping>
            <level value="ERROR"/>
            <foreColor value="Red, HighIntensity"/>
          </mapping>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net">
          <threshold value="ALL"/>
          <param name="File" value="logs/TaskServiceHarness"/>
          <param name="AppendToFile" value="true"/>
          <param name="RollingStyle" value="Date"/>
          <param name="DatePattern" value=".yyyy.MM.dd.'txt'"/>
          <param name="StaticLogFileName" value="false"/>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="eventLog" type="log4net.Appender.EventLogAppender,log4net">
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <root>
          <level value="ALL"/>
          <appender-ref ref="consoleDebug"/>
          <appender-ref ref="rollingFile"/>
          <appender-ref ref="eventLog"/>
          <appender-ref ref="telnetAppender"/>
        </root>
      </log4net>
    </setting>
  </stage>

  <!-- =============== SIT: SYSTEM INTEGRATION TEST =============== -->
  <stage name="sit">
    <setting key="log4net">
      <log4net>
        <appender name="trace" type="log4net.Appender.TraceAppender, log4net">
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="telnetAppender" type="log4net.Appender.TelnetAppender,log4net">
          <threshold value="ALL"/>
          <param name="port" value="7510"/>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="consoleDebug" type="log4net.Appender.ColoredConsoleAppender, log4net">
          <threshold value="ALL"/>
          <mapping>
            <level value="DEBUG"/>
            <foreColor value="Green, HighIntensity"/>
          </mapping>
          <mapping>
            <level value="WARN"/>
            <foreColor value="White, HighIntensity"/>
          </mapping>
          <mapping>
            <level value="INFO"/>
            <foreColor value="Yellow, HighIntensity"/>
          </mapping>
          <mapping>
            <level value="ERROR"/>
            <foreColor value="Red, HighIntensity"/>
          </mapping>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net">
          <threshold value="ALL"/>
          <param name="File" value="logs/TaskServiceHarness"/>
          <param name="AppendToFile" value="true"/>
          <param name="RollingStyle" value="Date"/>
          <param name="DatePattern" value=".yyyy.MM.dd.'txt'"/>
          <param name="StaticLogFileName" value="false"/>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="eventLog" type="log4net.Appender.EventLogAppender,log4net">
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <root>
          <level value="ALL"/>
          <appender-ref ref="consoleDebug"/>
          <appender-ref ref="rollingFile"/>
          <appender-ref ref="eventLog"/>
          <appender-ref ref="telnetAppender"/>
        </root>
      </log4net>
    </setting>
  </stage>

  <!-- =============== UAT: USER ACCEPTANCE TEST =============== -->
  <stage name="uat">
    <setting key="log4net">
      <log4net>
        <appender name="trace" type="log4net.Appender.TraceAppender, log4net">
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="telnetAppender" type="log4net.Appender.TelnetAppender,log4net">
          <threshold value="ALL"/>
          <param name="port" value="7510"/>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="consoleDebug" type="log4net.Appender.ColoredConsoleAppender, log4net">
          <threshold value="ALL"/>
          <mapping>
            <level value="DEBUG"/>
            <foreColor value="Green, HighIntensity"/>
          </mapping>
          <mapping>
            <level value="WARN"/>
            <foreColor value="White, HighIntensity"/>
          </mapping>
          <mapping>
            <level value="INFO"/>
            <foreColor value="Yellow, HighIntensity"/>
          </mapping>
          <mapping>
            <level value="ERROR"/>
            <foreColor value="Red, HighIntensity"/>
          </mapping>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net">
          <threshold value="ALL"/>
          <param name="File" value="logs/TaskServiceHarness"/>
          <param name="AppendToFile" value="true"/>
          <param name="RollingStyle" value="Date"/>
          <param name="DatePattern" value=".yyyy.MM.dd.'txt'"/>
          <param name="StaticLogFileName" value="false"/>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="eventLog" type="log4net.Appender.EventLogAppender,log4net">
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
          <threshold value="ERROR"/>
          <to value="blah@blah.com"/>
          <from value="blah@blah.com"/>
          <subject value="Task Service Harness (UAT) Error Message"/>
          <smtpHost value="localhost"/>
          <bufferSize value="1"/>
          <lossy value="false"/>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <root>
          <level value="DEBUG"/>
          <appender-ref ref="consoleDebug"/>
          <appender-ref ref="rollingFile"/>
          <appender-ref ref="eventLog"/>
          <appender-ref ref="telnetAppender"/>
          <appender-ref ref="smtp"/>
        </root>
      </log4net>
    </setting>
  </stage>

  <!-- =============== PRODUCTION =============== -->
  <stage name="prod">
    <setting key="log4net">
      <log4net>
        <appender name="trace" type="log4net.Appender.TraceAppender, log4net">
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="telnetAppender" type="log4net.Appender.TelnetAppender,log4net">
          <threshold value="ALL"/>
          <param name="port" value="7510"/>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="consoleDebug" type="log4net.Appender.ColoredConsoleAppender, log4net">
          <threshold value="ALL"/>
          <mapping>
            <level value="DEBUG"/>
            <foreColor value="Green, HighIntensity"/>
          </mapping>
          <mapping>
            <level value="WARN"/>
            <foreColor value="White, HighIntensity"/>
          </mapping>
          <mapping>
            <level value="INFO"/>
            <foreColor value="Yellow, HighIntensity"/>
          </mapping>
          <mapping>
            <level value="ERROR"/>
            <foreColor value="Red, HighIntensity"/>
          </mapping>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net">
          <threshold value="ALL"/>
          <param name="File" value="logs/TaskServiceHarness"/>
          <param name="AppendToFile" value="true"/>
          <param name="RollingStyle" value="Date"/>
          <param name="DatePattern" value=".yyyy.MM.dd.'txt'"/>
          <param name="StaticLogFileName" value="false"/>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="eventLog" type="log4net.Appender.EventLogAppender,log4net">
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <appender name="smtp" type="log4net.Appender.SmtpAppender, log4net">
          <threshold value="ERROR"/>
          <to value="blah@blah.com"/>
          <from value="blah@blah.com"/>
          <subject value="Task Service Harness Error Message"/>
          <smtpHost value="localhost"/>
          <bufferSize value="1"/>
          <lossy value="false"/>
          <layout type="log4net.Layout.PatternLayout,log4net">
            <param name="ConversionPattern" value="%date [%-5thread] %-5level %logger - %message%newline %exception"/>
          </layout>
        </appender>
        <root>
          <level value="INFO"/>
          <appender-ref ref="rollingFile"/>
          <appender-ref ref="eventLog"/>
          <appender-ref ref="smtp"/>
        </root>
      </log4net>
    </setting>
  </stage>

</application.settings>